package com.sias.interceptor;

import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * @author 吴文杰
 * @version 1.0
 * @createTime 2023-05-02 02:50:15
 */
public class LogInterceptor implements HandlerInterceptor {
  @Override
  public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
    String username = (String)request.getSession().getAttribute("username");
    System.out.println(username);
    return true;
  }
}
